import React,{useState,useEffect} from 'react'

export default function UseEffect() {
    const [name,setname]=useState("huahua")
    useEffect(()=>{
        setname(name.substring(0,1).toUpperCase()+name.substring(1))
        // [name]依赖name的改变
    },[name])
  return (
    <div>UseEffect---
        {name}
        <button onClick={()=>setname("xiaoming")}>click</button>
    </div>
  )
}
